package models.mappers;

import java.util.List;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import models.SystemParams;

public interface SystemParamMapper {
	/**
	 * 根据id获取系统变量对象
	 *
	 * @Title: getById 
	 * @param id
	 * @return
	 * @return: SystemParams
	 */
	@Select("select paramvalue from "
			+ SystemParams.TABLE_NAME
			+" where paramid=#{id}")
	String getValueById(String id);
	/**
	 * 获取系统参数列表
	 *
	 * @Title: listParams 
	 * @return
	 * @return: List<SystemParams>
	 */
	@Select("select paramid,paramvalue from "
			+ SystemParams.TABLE_NAME
			+" where isset=true")
	List<SystemParams> listParams();
	/**
	 * 保存参数
	 *
	 * @Title: saveParam 
	 * @param param
	 * @return: void
	 */
	@Update("update "
			+ SystemParams.TABLE_NAME
			+" set paramvalue=#{paramvalue},remark=#{remark} where paramid=#{paramid}")
	void saveParam(SystemParams param);
	
}
